package CollectionBaseTest;

import java.util.*;

/**
 * Created by yexuan on 2018/2/28.
 */
public class MapDemo {
    public static void main(String[] args) {
        Map<String, String> m = new HashMap<String, String>();
        m.put("01","a");
        m.put("02","b");
        m.put("03","c");
        m.put("d","c");
        System.out.println(m);

        Collection<String> c = m.values();
        System.out.println(c);

        Set<String> s = m.keySet();
//        System.out.println(s);
        Iterator<String> it = s.iterator();
        while (it.hasNext()){
            String str = it.next();
            System.out.println("key="+str+"-----value="+m.get(str));
        }
    }

}
